package custom.security.dto;

import com.fasterxml.jackson.annotation.JsonView;
import custom.security.validator.MyNotBlank;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {

    public interface JsonSimple{}
    public interface JsonDetail extends JsonSimple{}


    private String id;

    @MyNotBlank(message = "名称不能为空")
    @JsonView(JsonSimple.class)
    private String username;

    @NotBlank
    @JsonView(JsonDetail.class)
    private String password;

    @NotNull
    @JsonView(JsonSimple.class)
    private Date birthday;
}
